"""

类和对象的关系，即面向对象的编程套路（思想）
"""


# 设计一个闹钟类
class Clock:
    id = None
    price = None

    def ring(self):
        import winsound
        winsound.Beep(2000, 3000)


# 构建2个闹钟对象并让其工作
clock1 = Clock()
clock1.id = "00031"
clock1.price = '18.88'
print(f"闹钟id是{clock1.id},价格是{clock1.price}")
clock1.ring()

clock2 = Clock()
clock2.id = "00032"
clock2.price = '19.88'
print(f"闹钟id是{clock2.id},价格是{clock2.price}")
clock2.ring()
